#pragma once

#include <CGalaxyComponent.h>

class CGalaxyComponentBulge : public CGalaxyComponent {

 public:
  
 CGalaxyComponentBulge(CGalaxyParams* p, CComponentParams cp) : CGalaxyComponent( p, cp) {
  }
  
  double calculateIntensity(double I, CVector& p, double iscale) {
    double rho_0 = strength;
    CVector pp = p;
    CVector pos = params->bulgeAxis.Mul(rotmatFull.Mul(pp));
    CVector rp = pos;
    double rad = (rp.Length())*componentParams.arm;

    if (rad<0.01) rad = 0.01;
        double i = rho_0 * (pow(rad,-0.855)*exp(- pow(rad,1/4.0)) -0.10) *params->intensityScale*iscale;
	//double i = rho_0 * (pow(rad,-0.855)*exp(- pow(rad,1/4.0)) -0.0) *params->intensityScale*iscale;
    

    if (i<0) i=0;
    I+= i;

    return I;
    
  }


};
